from microbit import *

n = 1
while True:
    pin3.write_digital(n % 2)
    pin4.write_digital((n/2)%4)
    pin5.write_digital((n/4)%4)
    pin6.write_digital((n/8)%4)
    pin7.write_digital((n/16)%4)
    n *= 2
    if n > 16:
        n = 1
    sleep(1000)